struct ListNode* removeNthFromEnd(struct ListNode* head, int n) {
        struct stNode *pre=head,*end=head;

        while(n--) end = end->next;


        while(end && end->next) pre = pre->next,end = end->next;

        if(end == NULL) return head->next;
        else
        {
            ListNode *tmp = pre->next;
            pre->next = tmp->next;
            delete tmp;
        }

        return head;
}
